package com.example.personnel_oa.dubbo;

import com.example.comment_oa.dubbo.SysDeptServiceDubbo;
import com.example.comment_oa.pojos.SysDept;
import com.example.comment_oa.response.AjaxResponse;
import com.example.personnel_oa.service.SysDeptService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.List;


@DubboService(version = "1.0.0",protocol = "${dubbo.protocol.id}",
        application = "${dubbo.application.id}",registry = "${dubbo.registry.id}",
        timeout = 3000)
public class SysDeptServiceDubboImpl implements SysDeptServiceDubbo {
    @Resource
    SysDeptService service;

    //查询全部部门
    @Override
    public AjaxResponse selectDept() {
        List<SysDept> sysDepts = service.selectDept();
        return AjaxResponse.success(sysDepts);
    }

    //根据部门id查全部职位
    @Override
    public List<SysDept> selectDeptPost(int deptId) {
        List<SysDept> sysDepts = service.selectDeptPost(deptId);
        return sysDepts;
    }

    //查询全部部门不包含董事会
    @Override
    public List<SysDept> selectDepts() {
        List<SysDept> sysDepts = service.selectDepts();
        return sysDepts;
    }
}
